package cn.changeforyou.analyzer.xmlparse.mybatis.model;

import java.util.ArrayList;
import lombok.Data;
import org.dom4j.Node;

import java.io.File;
import java.util.List;
import org.dom4j.io.XMLWriter;

/**
 * mybatis xml文件的读取结果
 * @author zhyu
 */
@Data
public class MybatisXmlContent {
	
	private String namespace;
	private File file;
	private String tableName;
	private Node root;
	
	
	private List<MybatisXmlLabel> labels;
	private File xmlFile;
	
	public MybatisXmlContent() {
		labels = new ArrayList<>();
	}
	
	public void addAll(List<MybatisXmlLabel> labels) {
		for (MybatisXmlLabel label : labels) {
			label.setTableName(tableName);
		}
		this.labels.addAll(labels);
	}
	
	
	public File getXmlFile() {
		return xmlFile;
	}
}
